const Cache = require('./Cache')

class MappingPort extends Cache {
    constructor() {
        super('mapping-port')
    }
    async save(model) {
        return await super.upsert(
            {
                host: model.host,
                clientPort: model.clientPort
            },
            model
        )
    }
    async data(host) {
        return await super.find({
            host: host
        })
    }
    async remove(model) {
        return await super.remove({
            host: model.host,
            clientPort: model.clientPort
        })
    }
}
module.exports = MappingPort
